﻿<?xml version="1.0" encoding="utf-8" ?>
<Database Name="MvcEngine" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007">

	<Table Name="dbo.Containers" Member="MvcEngine.Core.Content.Container">
		<Type Name="MvcEngine.Core.Content.Container">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="SiteId" Member="SiteId" DbType="uniqueidentifier" CanBeNull="false"/>

			<Column Name="MarkupId" Member="MarkupId" DbType="NVarChar(50)" CanBeNull="false"/>
			<Column Name="MaxModuleCount" Member="MaxModuleCount" DbType="int" CanBeNull="true"/>

			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>

			<Association Name="FK_Containers_Sites"
							  Member="Sites"
							  ThisKey="SiteId"
							  OtherKey="Id"
							  IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.Logs" Member="MvcEngine.Core.Common.Log">
		<Type Name="MvcEngine.Core.Common.Log">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="SiteId" Member="SiteId" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="Type" Member="Type" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="Message" Member="Message" DbType="NVarChar(MAX)" CanBeNull="false"/>
			<Column Name="Exception" Member="Exception" DbType="NVarChar(MAX)" CanBeNull="true"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_Logs_Sites"
							  Member="Sites"
							  ThisKey="SiteId"
							  OtherKey="Id"
							  IsForeignKey="true" />
		</Type>
	</Table>


	<Table Name="dbo.Modules" Member="MvcEngine.Core.Content.Module">
		<Type Name="MvcEngine.Core.Content.Module">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>

			<Column Name="Version" Member="Version" DbType="NVarChar(50)" CanBeNull="false"/>
      <Column Name="IsInstallable" Member="IsInstallable" DbType="Bit" CanBeNull="false"/>
      <Column Name="OnePerPage" Member="OnePerPage" DbType="Bit" CanBeNull="false"/>
      <Column Name="Fields" Member="Xml" DbType="NVarChar(Max)" CanBeNull="true"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

		</Type>
	</Table>



	<Table Name="dbo.Controls" Member="MvcEngine.Core.Content.Control">
		<Type Name="MvcEngine.Core.Content.Control">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="ControlKey" Member="ControlKey" DbType="NVarChar(50)" CanBeNull="false"/>
			<Column Name="Visible" Member="Visible" DbType="Bit" CanBeNull="false"/>
			<Column Name="ModuleId" Member="ModuleId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="Description" Member="Description" DbType="NVarChar(256)" CanBeNull="false"/>
		    <Column Name="ControlServiceType" Member="ControlServiceType" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_Controls_Modules"
					  Member="Modules"
					  ThisKey="ModuleId"
					  OtherKey="Id"
					  IsForeignKey="true" />
		</Type>
	</Table>



	<Table Name="dbo.Pages" Member="MvcEngine.Core.Content.Page">
		<Type Name="MvcEngine.Core.Content.Page">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="SiteId" Member="SiteId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="SkinId" Member="SkinId" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="SkinTemplateId" Member="SkinTemplateId" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="ParentPageId" Member="ParentPageId" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="OrderNumber" Member="OrderNumber" DbType="int" CanBeNull="false"/>
			<Column Name="Title" Member="Title" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="MenuTitle" Member="MenuTitle" DbType="NVarChar(256)" CanBeNull="true"/>
			<Column Name="Visible" Member="Visible" DbType="Bit" CanBeNull="false"/>

			<Column Name="Header" Member="Header" DbType="NVarChar(MAX)" CanBeNull="true"/>
			<Column Name="Keywords" Member="Keywords" DbType="NVarChar(MAX)" CanBeNull="true"/>
			<Column Name="Description" Member="Description" DbType="NVarChar(MAX)" CanBeNull="true"/>

			<Column Name="Fields" Member="Xml" DbType="NVarChar(Max)" CanBeNull="true"/>

			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_Pages_Sites"
							  Member="Sites"
							  ThisKey="SiteId"
							  OtherKey="Id"
							  IsForeignKey="true" />

			<Association Name="FK_Pages_Skins"
									Member="Skins"
									ThisKey="SkinId"
									OtherKey="Id"
									IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.PageContents" Member="MvcEngine.Core.Content.PageContent">
		<Type Name="MvcEngine.Core.Content.PageContent">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="int" IsDbGenerated="true" CanBeNull="false"/>
			<Column Name="SiteId" Member="SiteId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="PageId" Member="PageId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="ContainerId" Member="ContainerId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="ControlId" Member="ControlId" DbType="uniqueidentifier" CanBeNull="false"/>

			<Column Name="Position" Member="Position" DbType="int" CanBeNull="false"/>
      <Column Name="ReferenceId" Member="ReferenceId" DbType="int" CanBeNull="true"/>

			<Column Name="ContentName" Member="ContentName" DbType="NVarChar(50)" CanBeNull="true"/>

			<Column Name="Fields" Member="Xml" DbType="NVarChar(Max)" CanBeNull="true"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_PageContents_Containers"
							  Member="Containers"
							  ThisKey="ContainerId"
							  OtherKey="Id"
							  IsForeignKey="true" />

			<Association Name="FK_PageContents_Controls"
							  Member="Controls"
							  ThisKey="ControlId"
							  OtherKey="Id"
							  IsForeignKey="true" />

			<Association Name="FK_PageContents_Sites"
							  Member="Sites"
							  ThisKey="SiteId"
							  OtherKey="Id"
							  IsForeignKey="true" />

			<Association Name="FK_PageContents_Pages"
							  Member="Pages"
							  ThisKey="PageId"
							  OtherKey="Id"
							  IsForeignKey="true" />

		</Type>
	</Table>

	<Table Name="dbo.Roles" Member="MvcEngine.Core.Account.Role">
		<Type Name="MvcEngine.Core.Account.Role">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="SiteId" Member="SiteId" DbType="uniqueidentifier" CanBeNull="false"/>

			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="LoweredName" Member="LoweredName" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="Description" Member="Description" DbType="NVarChar(256)" CanBeNull="true"/>

			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_Roles_Sites"
							  Member="Sites"
							  ThisKey="SiteId"
							  OtherKey="Id"
							  IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.Sites" Member="MvcEngine.Core.Website.Site">
		<Type Name="MvcEngine.Core.Website.Site">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="SkinId" Member="SkinId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="Fields" Member="Xml" DbType="NVarChar(MAX)" CanBeNull="true"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_Sites_Skins"
				  Member="Skins"
				  ThisKey="SkinId"
				  OtherKey="Id"
				  IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.SiteDomains" Member="MvcEngine.Core.Website.SiteDomain">
		<Type Name="MvcEngine.Core.Website.SiteDomain">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="SiteId" Member="SiteId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_SiteDomains_Sites"
							  Member="Sites"
							  ThisKey="SiteId"
							  OtherKey="Id"
							  IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.Skins" Member="MvcEngine.Core.Website.Skin">
		<Type Name="MvcEngine.Core.Website.Skin">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>
		</Type>
	</Table>

	<Table Name="dbo.SkinTemplates" Member="MvcEngine.Core.Website.SkinTemplate">
		<Type Name="MvcEngine.Core.Website.SkinTemplate">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(50)" CanBeNull="false"/>
			<Column Name="Description" Member="Description" DbType="NVarChar(256)" CanBeNull="true"/>
			<Column Name="SkinId" Member="SkinId" DbType="uniqueidentifier" CanBeNull="false"/>

			<Column Name="IsDefault" Member="IsDefault" DbType="Bit" CanBeNull="false"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>
			<Association Name="FK_SkinTemplates_Skins"
				  Member="Skins"
				  ThisKey="SkinId"
				  OtherKey="Id"
				  IsForeignKey="true" />

			<Association Name="FK_SkinTemplates_Users"
							   Member="Users"
							   ThisKey="CreatedBy"
							   OtherKey="Id"
							   IsForeignKey="true" />

			<Association Name="FK_SkinTemplates_Users1"
				   Member="Users"
				   ThisKey="ModifiedBy"
				   OtherKey="Id"
				   IsForeignKey="true" />
			
		</Type>
	</Table>

	<Table Name="dbo.Users" Member="MvcEngine.Core.Account.User">
		<Type Name="MvcEngine.Core.Account.User">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="SiteId" Member="SiteId" DbType="uniqueidentifier" CanBeNull="false"/>

			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="Email" Member="Email" DbType="NVarChar(256)" CanBeNull="false"/>

      <Column Name="FirstName" Member="FirstName" DbType="NVarChar(256)" CanBeNull="false"/>
      <Column Name="LastName" Member="LastName" DbType="NVarChar(256)" CanBeNull="false"/>
      <Column Name="Male" Member="Male" DbType="Bit" CanBeNull="false"/>
      <Column Name="BirthDay" Member="BirthDay" DbType="DateTime" CanBeNull="false"/>

      <Column Name="IsHost" Member="IsHost" DbType="Bit" CanBeNull="false"/>

			<Column Name="Password" Member="Password" DbType="NVarChar(128)" CanBeNull="false"/>
			<Column Name="PasswordSalt" Member="PasswordSalt" DbType="NVarChar(128)" CanBeNull="false"/>

			<Column Name="FailedPasswordAttemptCount" Member="FailedPasswordAttemptCount" DbType="Int" CanBeNull="false"/>
			<Column Name="FailedPasswordAnswerAttemptCount" Member="FailedPasswordAnswerAttemptCount" DbType="Int" CanBeNull="false"/>

			<Column Name="IsApproved" Member="IsApproved" DbType="Bit" CanBeNull="false"/>
			<Column Name="IsLockedOut" Member="IsLockedOut" DbType="Bit" CanBeNull="false"/>

			<Column Name="CreateGuid" Member="CreateGuid" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="RestoreGuid" Member="RestoreGuid" DbType="uniqueidentifier" CanBeNull="true"/>

			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_Users_Sites"
							  Member="Sites"
							  ThisKey="SiteId"
							  OtherKey="Id"
							  IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.UsersInRoles" Member="MvcEngine.Core.Account.UserInRole">
		<Type Name="MvcEngine.Core.Account.UserInRole">

			<Column Name="UserId" Member="UserId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="RoleId" Member="RoleId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_UsersInRoles_Roles"
							  Member="Roles"
							  ThisKey="RoleId"
							  OtherKey="Id"
							  IsForeignKey="true" />

			<Association Name="FK_UsersInRoles_Users"
					  Member="Users"
					  ThisKey="UserId"
					  OtherKey="Id"
					  IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.Permissions" Member="MvcEngine.Core.Account.Permission">
		<Type Name="MvcEngine.Core.Account.Permission">
			<Column Name="Id" Member="Id" DbType="uniqueidentifier" IsPrimaryKey="true" CanBeNull="false" />
			
			<Column Name="Key" Member="Key" DbType="NVarChar(50)" CanBeNull="false" />
      <Column Name="Code" Member="Code" DbType="NVarChar(50)" CanBeNull="false" />
      <Column Name="Name" Member="Name" DbType="NVarChar(50)" CanBeNull="false" />
			
			<Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

      <Association Name="FK_Permissions_Users"
						 Member="Users"
						 ThisKey="CreatedBy"
						 OtherKey="Id"
						 IsForeignKey="true" />
      
			<Association Name="FK_Permissions_Users1"
				   Member="Users"
				   ThisKey="ModifiedBy"
				   OtherKey="Id"
				   IsForeignKey="true" />
		</Type>
	</Table>

  
  <Table Name="dbo.ControlPermissions" Member="MvcEngine.Core.Account.ControlPermission">
    <Type Name="MvcEngine.Core.Account.ControlPermission">
      <Column Name="Id" Member="Id" DbType="uniqueidentifier" IsPrimaryKey="true" CanBeNull="false" />

      <Column Name="PageContentId" Member="PageContentId" DbType="int" CanBeNull="false" />
      <Column Name="PermissionId" Member="PermissionId" DbType="uniqueidentifier" CanBeNull="false" />
      <Column Name="RoleId" Member="RoleId" DbType="uniqueidentifier" CanBeNull="false" />

      <Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
      <Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
      <Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
      <Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

      <Association Name="FK_ControlPermissions_PageContents"
             Member="PageContents"
             ThisKey="ControlId"
             OtherKey="Id"
             IsForeignKey="true" />
      
      <Association Name="FK_ControlPermissions_Permissions"
             Member="Permissions"
             ThisKey="PageContentId"
             OtherKey="Id"
             IsForeignKey="true" />

      <Association Name="FK_ControlPermissions_Roles"
             Member="Roles"
             ThisKey="RoleId"
             OtherKey="Id"
             IsForeignKey="true" />

      <Association Name="FK_ControlPermissions_Users"
						 Member="Users"
						 ThisKey="CreatedBy"
						 OtherKey="Id"
						 IsForeignKey="true" />

      <Association Name="FK_ControlPermissions_Users1"
				     Member="Users"
				     ThisKey="ModifiedBy"
				     OtherKey="Id"
				     IsForeignKey="true" />
    </Type>
  </Table>


  <Table Name="dbo.PagePermissions" Member="MvcEngine.Core.Account.PagePermission">
    <Type Name="MvcEngine.Core.Account.PagePermission">
      <Column Name="Id" Member="Id" DbType="uniqueidentifier" IsPrimaryKey="true" CanBeNull="false" />

      <Column Name="PageId" Member="PageId" DbType="uniqueidentifier" CanBeNull="false" />
      <Column Name="PermissionId" Member="PermissionId" DbType="uniqueidentifier" CanBeNull="false" />
      <Column Name="RoleId" Member="RoleId" DbType="uniqueidentifier" CanBeNull="false" />

      <Column Name="CreatedBy" Member="CreatedBy" DbType="uniqueidentifier" CanBeNull="true"/>
      <Column Name="ModifiedBy" Member="ModifiedBy" DbType="uniqueidentifier" CanBeNull="true"/>
      <Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
      <Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

      <Association Name="FK_PagePermissions_Permissions"
             Member="Permissions"
             ThisKey="PageId"
             OtherKey="Id"
             IsForeignKey="true" />

      <Association Name="FK_PagePermissions_Pages"
             Member="Pages"
             ThisKey="PageId"
             OtherKey="Id"
             IsForeignKey="true" />
      
      <Association Name="FK_PagePermissions_Roles"
             Member="Roles"
             ThisKey="RoleId"
             OtherKey="Id"
             IsForeignKey="true" />

      <Association Name="FK_PagePermissions_Users"
						 Member="Users"
						 ThisKey="CreatedBy"
						 OtherKey="Id"
						 IsForeignKey="true" />

      <Association Name="FK_PagePermissions_Users1"
				     Member="Users"
				     ThisKey="ModifiedBy"
				     OtherKey="Id"
				     IsForeignKey="true" />
    </Type>
  </Table>


</Database>